package com.example.base.mvvm

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModelProvider

abstract class BaseViewActivity<VDB:ViewDataBinding>:AppCompatActivity() {
    //定义两个变量 延迟初始化
    lateinit var binding:VDB
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = DataBindingUtil.setContentView(this,getLayout())
        initView()
        initData()
    }

    abstract fun initView()

    abstract fun initData()


    abstract fun getLayout(): Int

}